package com.zhixue.message.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhixue.message.model.po.MqMessage;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Auther: 李 力
 * @Date: 2025/5/6
 * @Description: com.zhixue.message.mapper
 * @version: 1.0
 */

public interface MqMessageMapper extends BaseMapper<MqMessage> {
    @Select("SELECT t.* FROM mq_message t WHERE t.id % #{shardTotal} = #{shardindex} and t.state='0' and t.message_type=#{messageType} limit #{count}")
    List<MqMessage> selectListByShardIndex(@Param("shardTotal") int shardTotal, @Param("shardindex") int shardindex, @Param("messageType") String messageType, @Param("count") int count);
}
